import { extend } from 'umi-request';
import { message } from 'antd';
const request = extend({
  // prefix: 'http://pudge.wang:3000/api',
  //   prefix:
  //     'http://api.k780.com/?app=weather.realtime&weaId=1&ag=today,&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json',
  //   timeout: 1000,
});
const http = {
  get(id: string) {
    return request
      .get(
        `http://api.k780.com/?app=weather.realtime&weaId=${id}&ag=today,&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json`,
      )
      .then((response) => {
        return response;
      })
      .catch((error) => {
        message.error(error);
      });
  },
  post() {},
};
export default http;
